package cn.xuziao.databasecourse.tools;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author xuziao
 * @date 2021/12/11 14:33
 */

public class ReManager {
    public static String getCNKIImgName(String path) {
//        String test = "oss://xza-bucket/databasecourse/CNKI/PDF和图像/民族文化中宗教和谐与整合的隐喻——以四川硗碛嘉绒藏族乡为研究个案_陈焱.pdf";
        Pattern r = Pattern.compile("(?<=imge/).*(?=_.*_)");
//        Pattern r = Pattern.compile("(?<=PDF和图像/).*(?=_)");
        Matcher m = r.matcher(path);
        if (m.find()){
            return m.group(0);
        } else {
            return path;
        }
    }
}
